package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.AssetDisposal;
import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/AssetDisposalMapper.class */
public interface AssetDisposalMapper {
    @Select({"<script>", "select a.*,d.dict_name as assetDisposalName,u.name as userName from asset_disposal a left join dict_data d on d.dict_type = 'asset_disposal' and a.type = d.dict_value  left join user u on u.id = a.user_id  <where> <if test='id != null '>assets_id = #{id} </if><if test='time1 != null and time1.length() &gt; 0 and time2 != null and time2.length() &gt; 0'> and a.create_time between #{time1} and #{time2} </if></where> order by id asc</script>"})
    @Results({@Result(column = "assets_id", property = "assetsId", jdbcType = JdbcType.INTEGER), @Result(column = "user_id", property = "userId", jdbcType = JdbcType.INTEGER), @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.VARCHAR)})
    List<AssetDisposal> findById(@Param("id") Integer num, @Param("time1") String str, @Param("time2") String str2);

    @Insert({"insert into asset_disposal(type,create_time,user_id,assets_id) values(#{type},#{createTime},#{userId},#{assetsId})"})
    Integer add(@Param("type") Integer num, @Param("createTime") String str, @Param("userId") Integer num2, @Param("assetsId") Integer num3);
}